<template>
  <el-container>
    <el-header style="background-color:#409EFF">
      <el-row>
        <el-col :span="4">
          <div class="nav-logo" @click="goHome()">商城小程序后台管理</div>
        </el-col>
        <el-col :span="17">
          <!-- 导航组件 -->
          <!-- <navMenuRouter></navMenuRouter> -->
          <span>&nbsp;</span>
        </el-col>
        <el-col :span="3">
          <el-dropdown style="float:right;margin-right:20px">
            <span class="el-dropdown-link" style="color:#fff">
              <el-avatar
                :size="32"
                style="position: relative; top: 12px;"
                src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
              ></el-avatar>
              <span>admin</span>
              <!-- <i class="el-icon-arrow-down el-icon--right"></i> -->
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>个人中心</el-dropdown-item>
              <el-dropdown-item>账号设置</el-dropdown-item>
              <!-- <el-dropdown-item>螺蛳粉</el-dropdown-item> -->
              <!-- <el-dropdown-item disabled>双皮奶</el-dropdown-item> -->
              <el-dropdown-item divided @click.native="loginOut()">退出登录</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-col>
      </el-row>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <!-- 左侧导航 -->
        <!-- <leftMenuRouter></leftMenuRouter> -->
        <!-- <leftNav></leftNav> -->
        <navLeft></navLeft>
      </el-aside>
      <el-container>
        <el-main>
          <!-- 内容模块 -->
          <!-- <mainCon></mainCon> -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </el-container>
</template>
<script>
import navMenu from "@/components/navMenu";
import navMenuRouter from "@/components/navMenuRouter";
import navLeft from "@/components/navLeft";
import leftNav from "@/components/leftNav";
import leftMenu from "@/components/leftMenu";
import leftMenuRouter from "@/components/leftMenuRouter";
import mainCon from "@/pages/mainCon";
import Home from "@/pages/Home";
export default {
  name: "index",
  components: {
    navMenu,
    leftMenu,
    mainCon,
    navMenuRouter,
    leftMenuRouter,
    leftNav,
    navLeft
  },
  data() {
    return {
      title: "首页"
    };
  },
  methods: {
    // 返回首页
    goHome: function() {
      this.$router.push("/");
    },
    // 退出登录
    loginOut: function() {
      console.log("1111", "el-dropdown-item");
      this.$message("您已退出");
      // this.$store.dispatch("logout", false);
      this.$router.push("/login");
    }
  }
};
</script>
<style scoped>
.el-header {
  padding: 0;
}
.nav-logo {
  color: #fff;
  font-size: 20px;
  line-height: 60px;
  padding: 0 20px;
  text-align: center;
  cursor: pointer;
}
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

/* .el-aside { */
/* background-color: #d3dce6; */
/* color: #333; */
/* text-align: center; */
/* line-height: 200px; */
/* } */

.el-main {
  /* background-color: #fafafa; */
  background-color: #ffffff;
  /* color: #333; */
  /* text-align: center; */
  /* line-height: 160px; */
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
/* 下拉选 */
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
</style>